<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    .box{
      width:200px;
      height:200px;
      background-color: pink;
      position: absolute;
      left:50%;
      top:50%;
      transform: translate(-50%,-50%) rotateX(50deg);
      /* transform-origin: top left; */
      transform-style: preserve-3d;
      perspective: 300px;
      
    }
    .box1{
      width:200px;
      height:200px;
      background-color: red;
      position: absolute;
      left:50%;
      top:50%;
      transform: translate(-50%,-50%) rotateY(70deg);
      /* transform-origin: top left; */
      transform-style: preserve-3d;
      perspective: 300px;
      perspective-origin: 10px 100px; 
    }
    .box3 {
      
      width:300px;
      height:300px;
      margin: 200px auto;
      background-color: #00f; 
      transform-origin: top left;
      transition: all 0.3s;
    }
     .box3:hover{
       
       transform: rotate(360deg);
       

     }
  </style>
</head>
<body>
  <div class="box"></div>
  <div class="box1"></div>
  <div class="box3"></div>
</body>
</html>